#pragma once

#include "ClientButton.h"
#include "VideoWindow.h"

#define WM_ADD_CHANNEL		WM_USER + 1958
#define WM_REMOVE_CHANNEL	WM_USER + 1959

// CCameraInfo
class CCameraInfo
{
public:
	CCameraInfo(void);
	~CCameraInfo(void);

public:
	WCHAR	wchCameraName[128];
	int		nFPS;
	int		nResolution;
	int		nBrightness;
	int		nContrast;
	int		nPTZX;
	int		nPTZY;
	int		nPTZZ;
	int		nPTZZoom;
	BOOL	bIsPTZEnable;
	BOOL	bIsPreviewOn;

	int		isOwnerState;
public:
	void SetCameraName(WCHAR* pCameraName);
};


// CCameraWindow
class CCameraWindow : public CWnd
{
	DECLARE_DYNAMIC(CCameraWindow)

public:
	CCameraWindow();
	virtual ~CCameraWindow();

public:
	int			nOwnerIndex;
	CCameraInfo* pCameraInfo;

protected:
	CStatic *stFPSTitle, *stResolutionTitle, *stBrightnessTitle, *stContrastTitle, *stPTZTitle, *stPreviewTitle, *stPTZXTitle, *stPTZYTitle, *stPTZZTitle, *stPTZZoomTitle, *stCameraName;
	CEdit	*stPTZXValue, *stPTZYValue, *stPTZZValue, *stPTZZoomValue;
	CComboBox *cmbFPSValues, *cmbResolutionValues;
	CButton *chkPreview;
	CSliderCtrl *scBrightness, *scContrast;
	CClientButton *btnAddDevice, *btnRemoveDeivce;
	LOGFONT m_defFont;
	CFont m_cFont;

	CVideoWindow *stVideoWindow;

	BOOL m_bIsCreated;
	CImageList m_imgAddButtons, m_imgRemoveButtons;

public:
	void SetCameraInfo(CCameraInfo* cameraInfoTmp);
	void SetVariableForControls();

private:
	void DrawAllControls();
	void ResizeForControls();
	void DestroyAllControls();
	void OnAddDeviceClick();
	void OnRemoveDeviceClick();

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnDestroy();
	virtual BOOL PreTranslateMessage(MSG* pMsg);
};


